package com.liugui.lambda;

import java.util.Arrays;
import java.util.stream.Stream;

/**
 * @ClassName: MergerStream
 * @Author: liugui
 * @Date: 2020-11-05 14:56
 **/
public class MergerStream {
    public static void main(String[] args) {


        Stream<Integer> stream1 = Stream.of(1, 2, 3);

        Stream<Integer> stream2 = Stream.of(4, 5, 6);

        Stream<Integer> stream3 = Stream.of(7, 8, 9);

        Stream<Stream<Integer>> streamStream = Stream.of(stream1,stream2,stream3);

        Stream<Integer> integer = streamStream.flatMap((i)->i);

        integer.forEach(System.out::print);

    }
}
